package com.neuedu.nep.service.impl;

import com.neuedu.nep.dao.AdminDao;
import com.neuedu.nep.model.*;
import com.neuedu.nep.service.AdminService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author 黄宇佳
 * @create 2024-04-12 11:36
 * @description:
 */
@Service
public class AdminServiceImpl implements AdminService {
    @Resource
    private AdminDao adminDao;


    @Override
    public Admin SignIn(String adminCode, String password) {
        AdminExample example=new AdminExample();
        AdminExample.Criteria criteria=example.createCriteria();
        criteria.andAdminCodeEqualTo(adminCode).andPasswordEqualTo(password);
        List<Admin> admins = adminDao.selectByExample(example);
        if (admins.size()>0){
            return admins.get(0);
        }else{
            return null;
        }

    }
}
